/**
 * 
 */
package net.sf.cldsql.dj.container;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

import net.sf.cldsql.dj.container.DiContainer;
import net.sf.cldsql.dj.container.base.DiAop;

/**
 * DiTestAop
 */
public class DiTestAop implements DiAop<TestBean> {
    @SuppressWarnings("unused")
    private DiContainer container;
    public void before(TestBean delegate, Method method, Object[] args) {
        delegate.setValue("a");
    }
    public Object after(TestBean delegate, Method method, Object[] args, Object result) {
        delegate.setValue(null);
        return result;
    }
    public void error(TestBean delegate, Method method, Object[] args, Exception e) {
        e.printStackTrace(System.out);
    }
    public void finalli(TestBean delegate, Method method, Object[] args) {
    }
    public void setContainer(DiContainer container) {
        this.container = container;
    }
    public TestBean afterCreate(TestBean delegate, Constructor constructor, Object[] args, TestBean proxy) {
        return proxy;
    }
    public TestBean beforeCreate(TestBean delegate, Constructor constructor, Object[] args) {
        return delegate;
    }

}
